<?php
global $var_yttheme;
$_productCollection = $this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
$imgWidth = $this->product_image_width;
$imgHeight = $this->product_image_height;
if ($imgWidth <= 0 || $imgHeight <= 0){
	$this->product_image_disp = false;
}
?>
<div class="block left-products">
	<div class="block-title">
		<strong>
			<span><?php echo $this->title ?></span>
		</strong>
	</div>
	<div class="block-content">
		<div class="left-product-base">
			<?php if(!$_productCollection->count()): ?>
			<p class="note-msg">
				<?php echo $this->__('There are no products matching the selection.') ?>
			</p>
			<?php else: 
			$row = 0;
			$col= 0;
			$count = 1;
			$i=0;
			$j=0;
			$_collectionSize = $_productCollection->count();
			foreach($_productCollection as $_product): $j++;
			$this->_reviewsHelperBlock = $this->getLayout()->createBlock('review/helper');
			?>
			<?php if ($i++==0): ?>
			<div class="list-items">
				<?php endif ?>
				<div class="item <?php if ( $i == 1 ){echo "first";} ?> <?php if($i%2==0) echo $this->__('odd')?>">
					<div class="item-inner">
						<?php if ($this->product_image_disp): ?>
						<div class="product-image">
							<a href="<?php echo $_product->getProductUrl() ?>"
								title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"
								class="product-imgs"><img
								src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($this->product_image_width,$this->product_image_height); ?>"
								alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
							</a>
						</div>
						<?php endif; ?>
						<div class="item-box-content">
							<?php if ($this->product_title_disp){ ?>
							<h2 class="product-name">
								<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
								<?php
								if ( $this->product_title_max_length > 0){
										$_productNameTruncated = Mage::helper('core/string')->truncate($_productNameStripped, $this->product_title_max_length);
									}
									?>
								<a href="<?php echo $_product->getProductUrl() ?>"
									title="<?php echo $this->stripTags($_product->getName(), null, true) ?>">
									<?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?>
								</a>
							</h2>
							<?php  } ?>

							<?php if ($this->product_description_disp): ?>
                            <div class="item-description">
                                <?php
                                    $product_description_src = in_array($this->product_description_src, array('short_description', 'description')) ? $this->product_description_src : 'short_description';
                                    $product_description = $_helper->productAttribute($_product, $_product->$product_description_src, $product_description_src);
                                    
                                    if ( $this->product_description_strip_tags ){
                                        $allow_tags = $this->product_description_keep_tags ? $this->product_description_keep_tags : null;
                                        $product_description = $this->stripTags( $product_description,  $allow_tags, true);
                                    }
                                    
                                    if ( $this->product_description_max_length > 0){
                                        $product_description = Mage::helper('core/string')->truncate($product_description, (int)$this->product_description_max_length);
                                    }
                                    
                                    echo $product_description;
                                ?>
                            </div>
							<?php endif; ?>
							
							<?php if ($this->product_price_disp): ?>
							<div class="price-wrapper">
								<div class="price-block">
									<?php echo $this->getPriceHtml($_product, false, '_bugsleft') ?>
								</div>
							</div>
							<?php endif; ?>
							<?php if ($this->product_rating_summary): ?>
							<div class="item-review">
								<?php  echo $this->getReviewsSummaryHtml($_product, "short", true); ?>
							</div>
							<?php endif; ?>
							
							<?php if ($this->product_cart_or_status): ?>
								<?php if($_product->isSaleable()): ?>
									<a title="<?php echo $this->__('Add to Cart') ?>" href="<?php echo $this->getAddToCartUrl($_product) ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></a>
								<?php else: ?>
									<span class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></span>
								<?php endif; ?>
							<?php endif; ?>
							
							<?php if($this->product_addtowishlist OR $this->product_addtocompare){ ?>
                            <div class="actions">
									<?php if($_compareUrl=$this->getAddToCompareUrl($_product) ): ?>
                                        <?php if($this->product_addtocompare){ ?>
                                        <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a>
                                        <?php } ?>
                                    <?php endif; ?>
                                    <?php if ($this->helper('wishlist')->isAllow() AND $this->product_addtowishlist) : ?>
                                        <a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
                                    <?php endif; ?>
                                    
                            </div>
                            <?php } ?>
						
						</div>
						<div style="clear:both;"></div>
					</div>
				</div>
				<?php if ($i==$_collectionSize): ?>
			</div>
			<?php endif ?>
			<?php endforeach; ?>
			<?php endif; ?>
		</div>
	</div>
</div>